import request from '@/utils/request'

// 获取面试官列表
export function getInterviewerList(params) {
  return request({
    url: '/api/system/interviewers/list',
    method: 'get',
    params
  })
}

// 新增面试官
export function addInterviewer(data) {
  return request({
    url: '/api/system/interviewers',
    method: 'post',
    data
  })
}

// 更新面试官
export function updateInterviewer(data) {
  return request({
    url: '/api/system/interviewers',
    method: 'put',
    data
  })
}

// 删除面试官
export function deleteInterviewer(ids) {
  return request({
    url: `/api/system/interviewers/${ids}`,
    method: 'delete'
  })
}

// 上传视频
export function uploadVideo(data) {
  return request({
    url: '/api/system/interviewers/uploadVideo',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    timeout: 300000 // 5分钟超时
  })
}

// 上传头像
export function uploadAvatar(data) {
  return request({
    url: '/api/system/interviewers/uploadAvatar',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 导出面试官数据
export function exportInterviewer(params) {
  return request({
    url: '/api/system/interviewers/export',
    method: 'post',
    params,
    responseType: 'blob'
  })
}